There are several different versions of an app, so please after purchase don't use the version of the app you already have on your computer.
In the email message we send after purchase, the instructions always indicate the link to download the correct version of the app that matches the code provided. So to solve the problem, please open the message we sent after purchase and download the linked app.
Once you download the app, put it in the "Applications" folder replacing the old one (don't worry, your data is save because is it not inside the app itself), then enter the registration code provided in the email message.
If instead, your problem is that you are trying to use an old code in a newly downloaded app, please take a look at this solution: