This is a pretty general statement without having more information.
If you’re only changing the CPU, I wouldn’t worry about it. It shouldn’t affect the stability of your memory but at worst it won’t boot and you’ll have to go into the BIOS and change your settings.
Not sure how much good this will do. I don’t keep my fridge in the bathroom.