OP since you purchased a new sealed copy of the BF3 premium edition and the code is coming up as invalid you'll need to speak to a Game Advisor who can audit the code and correct the situation. Please ensure you have your receipt handy in case the game advisor asks for it.
You can reach a game advisor here: https://help.ea.com/contact-us click on the orange button on the right to start a new case, follow the instructions and when you are presented with a contact method I recommend that you use the telephone option and the “call me” option so you don't have to stay on hold for a long time. The call back feature available to North America, Austria, Belgium, Czech Republic, Denmark, Finland, France, Germany, Hungary, Ireland, Italy, Netherlands, Norway, Poland, Portugal, Russia, Spain, Sweden, Slovakia, Switzerland, and the UK.