There's always ways around this
So the CD that came with the new PC, you can use it as long as it is the same Manufacturer as your old PC (e.g. both HP or both Dell). As far as the key goes, you can't (as Seti pointed out) use the key on your new PC to install Windows on the new PC. Those are OEM keys and can only be activated on one PC.
Some advice for the old PC, wipe it clean. Use a program like
DBAN to completely nuke the drive before you install Windows again. Windows has this awesome habit of reusing bad system files even after it 'formats' the drive, because it doesn't really format anything.