(Psychological / emotional perspective)
It is very easy to lock away the emotions, supposedly to keep them safe.
A lock appearing in a dream may alert us to the fact that we need to free up whatever we have shut away.
To force a lock would indicate that we need to work against our own inclinations to lock things away in order to be free of inhibitions.
To be mending a lock suggests that our personal space has been trespassed upon and we need to repair the damage.