If you get out of the car and you do not lock the car (with the key in the lock, or using the remote) then the car should not lock itself.
However, if you do lock the car (with the key in the lock, or using the remote) and then come back and unlock it, if you don't open any doors, it will lock itself again after about 30 seconds. In this case, since no doors have been opened, then there can't be any keys in the car from when it was unlocked.