lock (n.1) Look up lock at Dictionary.com
"means of fastening," Old English loc "bolt, fastening; barrier, enclosure," from Proto-Germanic *lukan (source also of Old Norse lok "fastening, lock," Gothic usluks "opening," Old High German loh "dungeon," German Loch "opening, hole," Dutch luik "shutter, trapdoor"). "The great diversity of meaning in the Teut. words seems to indicate two or more independent but formally identical substantival formations from the root."

The Old English sense "barrier, enclosure" led to the specific meaning "barrier on a river" (c. 1300), and the more specific sense "gate and sluice system on a water channel used as a means of raising and lowering boats" (1570s). Wrestling sense is from c. 1600. Phrase under lock and key attested from early 14c.
lock (n.2) Look up lock at Dictionary.com
"tress of hair," Old English locc "lock of hair, curl," from Proto-Germanic *lukkoz (source also of Old Norse lokkr, Old Saxon, Old Frisian, Dutch lok, Old High German loc, German Locke "lock of hair"), from PIE *lugnos-, perhaps related to Greek lygos "pliant twig, withe," Lithuanian lugnas "flexible."
lock (v.) Look up lock at Dictionary.com
"to fasten with a lock," c. 1300, from Old English lucan "to lock, to close" (class II strong verb; past tense leac, past participle locen), from the same root as lock (n.1). Cognate with Old Frisian luka "to close," Old Saxon lukan, Old High German luhhan, Old Norse luka, Gothic galukan. Meaning "to embrace closely" is from 1610s. Related: Locked; locking. Slang lock horns "fight" is from 1839.