I have an IP31 that has a system of lines and fairleads that lead from the hatches to the interior behind the companionway stairway with a cleat to tie them off. With this system, the hatches can be secured from inside and they provide security for the contents when the boat is left unattended. I certainly do not like the solution but it does work well.
I have been looking for a type of cabinet lock that has a pushbutton spring latch with a key that could be mounted on the hatch with the catch installed within the locker. This would provide the convenience and security needed for a cockpit locker. In spite of the obvious need for such a solution, I have yet to find one. If I come across something, I'll post it here.