If the hardware was replaced because of an OEM warranty issue then the pc manufacturer should provide you with a new product key. Otherwise, you may need to purchase a new product key.
--please don't forget to close up the thread here by marking answer if the reply is helpful--