Re: buying a new activation code
Yes, by buying the game. You can do that through Origin or other known sellers.
--
I'm trying to register my game but it says the serial code is invalid/already used
You bought the game on DVD and the box was not sealed/it's a used game
Used games cannot be re-registered. Take it back to where you bought it and get a refund.
Source: http://answers.ea.com/t5/The-Sims-4/FAQ-Serial-Codes-Game-Activation-and-Download-Issues/td-p/4228232