Are you worried that the key will not work in version 5.1? You can convert the key to license file and insert it in avast 5.1 pro. Let us know if that is what you are worried about.
Uninstall v4 via control panel and reboot to safe mode.
Open (execute) the uninstall utility and select avast 4 option in the drop down menu.
If you installed avast! in a different folder than the default, browse for it. (Note: Be careful! The content of any folder you choose will be deleted!)
Click REMOVE
Restart your computer to normal mode.
Then install v5.1 using the setup file you downloaded in step 1.