the correct way to program the key is to sit in the car and shut the door.
put the key in the ignition and turn it on (dont start the car)
while the lights are on the dash press 1 of the buttons on the key and hold it for about 15 seconds.
then release the button
take the key out and get out of the car
shut the door
wait for 20 seconds
try the locking now if it doesnt work now try disconnecting the car battery for 5 mins and reconnecting it then do the procedure again.
if it still doesnt work then it may really be a problem with the car.