There's a thread above that may be related re: electric door locks.
I also posted, and HT answered, about my own door lock issue on a
2000 Sonata, which may be related to your issue. The electric
door locks are one of a few circuits that remain live when the
keyswitch is off. For example, it's traditional for a car's
clock. Nowadays, the main computer (maybe all of them) needs
continuous power to hold all its settings, scans, readings, etc.
In my own case, my door locks have been electrically seized. The
circuitry is actually quite complicated because all the locks are
tied together in one-key-for-all at the _passenger_ door. The
seizure, however, was due to what looks to be a shorted switch on
the _driver's_ door, distributed to all four locks via the
passenger door. HT suggests that the shorting was caused by the
driver door latch hanging in mid-position.
Re: run-down battery: yes. My battery was run down so low from
this that the radio's stupid "you've lost your presets" alarm was
beeping and, much worse, the main computer lost its scan readings
right before a smog test was due. The failure mode simulated a
momentary switch that was permanently pressed, seizing all the
locks into "latching shut" mode.
Intermittent electrical failures are the bane of the electronics
repair business (if there's anything left of it).
Now, let's say that you have an intermittent short in your
clock's leads, that'll do it. This is on my mind a lot lately
because my phone/DSL was going in and out during the winter
because animals had chewed the insulation on a phone cable that
runs over the roof.