This is a simple short con that originated in the days when rail travel was common, and is still in use at bus stations and airports. There is a pretty good depiction of it in operation in the Peckinpah version of The Getaway.
The grifter approaches someone who is about to check their luggage into a coin locker, offers to help them and palms the key to the locker. He then gives the mark the key to another, empty locker that he has previously rented. Once the mark has gone about their business, he opens the locker and steals the luggage. This is usually done by a single operator, and usually at a time when there is a lot of traffic in the area. The grifter can't be sure how much time he has, and he may limit his activity to no more than one or two marks at a single time.