Ancient Egyptian pin tumbler lock first invented 4000 years ago.
In this picture you can see the lock workings. Just like the locks of today.