If A opens the lock then I say A=1 else A=0.

So now according to the condition given, AB+BC+CA+ABC=1 i.e. if any two or all 3 open the lock then vault opens.

Hence, AB=1, BC=2,CA=1 and ABC=1. After minimizing we get AB+BC+AC=1.

If realized using Nand gates we get 6.