And me wondering if I can do a clean install of Windows 8.1 with the key used to activate Windows 8 Upgrade edition
Unfortunately, no, you can't. The main problem is not that the W8.1 installer won't accept a W8 key, but that MS hasn't released a public W8.1 ISO file that anyone can use to do a clean install. At the moment, the only way to legally get such an ISO file is to have access to an MSDN or TechNet subscription. MS support staff claims that such an ISO file will be made available for everyone at a later time.
After downloading 8.1 it won't do anything as it is asking for a product key. When I enter either product key, it says it's not valid. Any thoughts on this or is my HP doomed to Windows 8 for good?
You can try one of these:
Core: 334NH-RXG76-64THK-C7CKG-D3VPT
Professional: XHQ8N-C3MCJ-RQXB6-WCHYG-C9WKB
These are not an illegal keys.
These are the default W8.1 installation keys. Previous versions of Windows automatically used such a key to execute the installer, but for some reason W8.1 does not. What this key won't do is activate Windows for you. For that you will need to provide your own key, but I suspect you may need to call MS (or Skype them) to get an updated key for W8.1.
Having said that, I would strongly recommend you do a clean install as soon as MS releases the 8.1 ISO files for everyone. If you get a new key from MS, then that will work both for installation and activation.
EDIT: It sounds like MS' support staff were wrong. Apparently MS doesn't intend to ever release such an ISO file.