To open the lock, move the left analog stick left twice and the right analog stick to the right twice as well.
To clear the passage, shoot the gunpowder barrel on the other side of the barricade. Further on you will have to solve a puzzle.
Use the left analog stick to turn the lens and the jump button to change the active one.
They should be placed in the following order: letter at the top, weight at the bottom, the circle with a cross on the left and the circle with an arrow on the right.
Keep turning both valves in opposite directions until the door opens. There aren't many combinations, so you should make it rather fast.
Inside one of the rooms you will find a lever which is used to lower and rise the elevator. Before using it, place a lantern on the platform.
With the item above, climb to it along the wall on the right. On the upper floor, once again leave the source of light and crawl through the narrow hole.
Behind it you will find a wall which can be used to climb even higher. Jump through two precipices there and you will reach a room on the other side of the grate.
From there, unlock the door, pick up the lantern and run forward.
Shoot the barrel through the wooden barrier and get to the other side along the corridor on the right.
Soon enough you should come across another lens puzzle. You need to place the lens in the following order: feather on the left, crown above, man on the right and letter below.
The puzzle will require you to place lens in proper positions. The order should be as follows: cross on the left, globe above, circle on the right and the weight below.
To open the gate, move the left analog stick left and afterwards the right analog to the right three times. That way you will turn the valves and open the door.