molex or sata power switch, electronics question

Hello. I have 1 tb magnetic drive inside the case that I use as backup. Viruses can’t access it unless power or data cable is unplugged. One problem with using this power switch, throwing that power switch while motherboard power is on would be bad. Can you make a circuit that would prevent you from changing power on/off while motherboard power is on?

Motherboard on/running -> molex switch fails
Motherboard powered down -> molex switch on/off