I have the same sort of lock as an additional security measure.
The "key" has pins that fit into the base of the ball lock that enable it to be unscrewed.
Having lost the key I got a piece of steel bar and "fastener and nut bolt" emgeineering supplier supplied 5 tiny roll pins (as per the original) and appropriate sized drill to make hole for them to be tapped into.
I turned the tow hitch over and used a piece of paper to map the position of the holes and then transfered them onto the end of the 3/4 round bar. I carefuly drilled the 5 holes and tapped the roll pins in the end, then drilled a hole through the side of the bar for a smaller bar to enable turning the key!
Took less than hour when I had the parts!