Yup, I changed motherboards on my partners pc last week and although windows said her key was no good, the relink option got it working again in just a few minuteshttps://www.nirsoft.net/utils/product_cd_key_viewer.html Might do it
If it's a retail key you shouldn't need to extract the key though - Swapping Motherboard without reinstalling will be fine anyway, but worst case you ensure that you have signed in to a microsoft account, and then the key gets linked to your account (or that's how I understand it)