I assume you wish to leave it warming up in cold weather.
You'll need both keys. If one is a remote key, and the other is a non-remote, use the non-remote to start the car.
Start the engine with the "spare" key.
Lock the car with the remote as usual.
In the UK, it is illegal to leave a car unattended with the engine running, unless on private property. You'll need to check your own local laws.
Despite being locked, someone could still just smash a window and drive away.