Please use following step replace your product key
Step 1. Search CMD in Windows Search next to Start, right-click on the first result and select Run as administrator. When asked that “do you want this app to make changes to your device?”, click Yes to confirm and open the command prompt.
Step 2. Input the following commands separately and press Enter after each command.
slmgr -upk (Uninstall previous product key)
slmgr -cpky (Clear product key registry)
slmgr -ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX (Replace XXXX with your product key / Install new product key)
slmgr -ato