lock in
phrasal verblock somebody/yourself in (…) 
- to prevent somebody from leaving a place by locking the door
- At 9 p.m. the prisoners are locked in for the night.
 
Extra Examples- I locked myself in the bathroom.
 - I was terrified they would lock me in again.