You reckon that there is anywhere that checks up on every prisoner every 3 minutes?
The actual situation was not a prison, it was a room with iron bars on the window that was locked and set on fire. But in general I don't think a spell that reads "Casting time: 1 hour. Open any iron, wooden, or stone door, wall, or safe" is 0th level or one that's good for the game (you need to be able to keep the party on the map somehow).