As far as I know an extra key will not help if the car is running and if you want to open the door with the extra key. Happened to us already - 1995 Corolla running. Left key in ignition, closed door and it locked. It was at home so we got spare key - no luck. Not even with the key on the lock to open it. We had to slim jim it open.

Why would you ever leave the key in the ignition if you know it locks when you close the door? Thank God our MB's can never be locked with the front doors if they're open. I can manually override this by opening the rear door and closing the front door then locking it from inside and closing the rear doors.

Just always make a mental note to open the window if you're going to open the door with the key in the ignition. Trust me, that open window will be manna from heaven if the door locks and you have no spare key.