Dial *#06#. The IMEI must match the one in Settings and on the box.
Xiaomi and Google accounts signed out, in front of you. Otherwise the phone stays locked when you reset it. Don’t buy a locked phone, not even at a discount.
Battery: charge it for a while. If it heats up or drains fast, plan on replacing the battery.