Help! 2003 Ford Expedition

I have an '03 expedition that will just shut off while I’m driving. No warning it just shuts down. The only way it will start back up is if I take the key out and put it back in then it cranks up fine. Is it the key that is going bad?