it is a second hand copy it is legit
Actually, you'll be disappointed to know that the typical EULA, including the one with SWBF2, prohibits selling the game. Keep in mind how these things work: You haven't bought the game itself, you've bought a license. You've purchased the rights to use their software. People rarely take the time to read what this license says, but most of them anymore do prohibit the reselling of a game once you've opened it. Funny that they make this information incredibly hard to find without opening the box.
If the seller didn't give you a key that works you can contact the maker of the game and see if they will give you a good one.
Doubtful. While some companies will do this for games that have some problem with their key*, Lucas cut support for this game a long time ago. They no longer respond to support requests for it.
*For example, and I might be mistaken, but I think it was Bioware that had problems with a bunch of Neverwinter Nights keys that got rejected when people tried to register their games. They were issues new keys in this case. The problem was actually the font the keys were printed in. Some letters, like I and 1 or O and 0, came out looking identical.