I want to prevent them from touching like this.
I mean how do I add the physics to it. Because in reality they won't overlap, but instead, collide.
That's more of an advanced topic (see CORE: Fundamentals of Physics) and for something like this, it's total overkill in my opinion.
Just Move and Rotate the Lock so it doesn't intersect and looks natural.
(If you'd add Rigid Body Physics to it as it is now, the lock would just fly away, because it's intersecting, so you'd need you get rid of the intersection, before adding Physics anyway.)