You must choose one path and stick with it or you run out of keys. Once you get to the end you can loot all the chests by visiting the adjacent rooms.