Technically, you have to do two things to answer that question.
1. Read the EULA for the game.
2. Scope the vendor to see what kind of vendor they are.
This topic has been covered before, and I'm sure if you did a search it might still show up. It's been a while. This kind of topic usually turns into a wad of software pirates trying to vendicate themselves in vain, so watch out.
Anyway, gaming companies account for this kind of stuff. It's called "Second Market Sales." A lot of times it's useless to the company, but sometimes they do actually get revenue back. This comes a lot of times from after-market vendors like Babbages, PCWorld, etc. A lot of game companies have contracts with those big franchies stores, allowing them to re-shelve and sell the games again. The profit is small, but it's the most legal way.
There's a lot of controversy about this kind of stuff.
Technically, most of it is illegal. Personally, although I have spent time in the gaming industry and have a huge beef about this kind of stuff, I don't really have much of a problem with these kinds of things because you get everything and the real keys.
If they're selling copies, or selling them with fake/generated keys, or they aren't giving you everything they got when they bought it, then I don't agree with that at all.
If you want a legal standpoint, PM me. Otherwise, douse yerself in water, because it's gonna get flamey in here soon.