The key has two parst to it, the part with the actual metal key and the part with the buttons on it where the key ring hooks on (the remote).
It sounds like you won't have to replace the key part, just the remote part. You have to make sure that the one you buy is the same part number as the one you have, otherwise you won't be able to program it to your car. They use different frequencies.
It is super simple to program to the car, you have to have at least two keys though. All you do is put one key in the ignition and turn it to on (but don't start the engine). Then get out of the car and put the other key (the one you want to program) in the driver's side door and lock the doors by turning it. Then, with the key still in the door lock, press the unlock button on the fob twice within five seconds of locking the doors. Your horn will honk or lights will flash telling you it's been programmed. And that's it. Now you have a working remote.