key
I had a similar situation with the ignition key on my old 89 Accord. When it was cold out and if the car wasn't fully warmed up, the car would turn off, but the key wouldn't push in during the last turn to remove it, and other times the auto shift lever wouldn't move out of park without the manual override. It replaced the shift selector in the console that tells the lights on the dash what gear the car is in and I never had the problem again. If it's an auto, try moving the shift lever back and forth in the park position while removing the key.