Then I switched the motherboard and windows decided I no longer had a key for it
The reason for this is that Windows builds an identifier based on the hardware of the machine on which it is installed. When that identifier doesn't match, it throws a flag that says "Hey now ..." I think that you still get a couple of "honor system passes" before the installed OS enforces anything.
Once that gets enforced, you can call Microsoft Clearinghouse, "I upgraded my hardware," and they'll give you a new key to enter.