Ankles can lock up in many situations. Edema, cramps due to cold during sleep, twisted ankles, etc.
Squeeze out the edema with the fingers, keep the feet, ankles and legs warm while sleeping, go to the doctor to check out the twisted ankles.
Rub some vapor rub on the ankles to keep the muscles around the ankles soft.
Sometimes stiff ankles feel like they are locked up.
Wearing shoes that are too stiff, driving long distances without moving the foot can also lead to stiff ankles and locked ankles.