Breaking electronic locks — just like in those hacker movies

A hacker connects a mysterious device to a lock, picks its code within a few seconds, and unlocks the door. That’s how it always happens in the movies, but is it the same in real life?