Since you were only buying the hitch, I would guess he meant a lock for the hitch. But there are two possibilities there. Some people put a lock on to secure the hitch to the truck bed so the hitch can't be easily removed from the truck. And some people put a lock on the pull handle so someone can't walk by and pull your release handle while you are stopped at a rest area, service station, restaurant, etc.
One for the release handle is a simple padlock. Depending on the type of hitch and locking it to the bed, a simple padlock may work there also. Or you may need a lock with a long shank to secure it to the rail(s).
I don't use either since I have a roll type tonneau cover to cover and hide the hitch when not towing, and we never leave the 5er unattended at any rest stop or service station along the way. And we do not stop and go into restaurants during travel times.