Why change the ECU if the problem was caused by a failed key? Do you have a spare key?
Attempting to use the wrong key can result in the car being immobilized.
You would need to compare the Nissan Part Numbers on the ECU to determine if a different year model will work in your car.
5th generation owners, who are good with computers, can use a product named NDS2 at
www.nissandatascan.com to reset the Nissan Anti Theft System (NATS).
NDS2 video below.
https://www.youtube.com/watch?v=SmQsR1rqUfA