The replacement factory keyless entry key fob for a 1998 1999 2000 2001 or 2002 Mazda 626 is Remotes Unlimited part 617-1617. This is a 3-button remote transmitter with FCC ID NHVWB1U215. You can see and buy the brand new OE keyfob at the following link:
2002 Mazda 626 Remote
You can program 1998-2002 Mazda 626 vehicles yourself to accept a new transmitter. Programming instructions and free phone technical support are included with purchase.
Remotes Unlimited also offers B-grade and R-grade parts for this remote. B-grade parts are used parts that have been tested and given a new battery. R-grade parts have been refurbished by putting the circuit board in a new replacement case with a new battery. We do not offer these parts on our website at this time, so you will have to call us at 877-719-1900 (toll-free) to place an order for a B-grade or R-grade remote.