Presuming that your key is for use on Steam (check the game page - some of our keys are redeemed elsewhere)...
Due to demand Steam sometimes presents longer keys.
Because of this our keys are sometimes sold in the format:
XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX (4 sets of 7 digits)
This is not an invalid key and can be redeemed normally on Steam.
However, for Steam to recognise this key and accept it then you must ensure you update to the latest version of Steam.
Go to the 'Steam' menu in the Steam client and choose 'Check for Steam client updates'.
Install any updates and try using your key again.