Digital pianos age very differently from acoustic ones: there's no soundboard or strings to worry about, but electronics and moving mechanical parts (the keybed, pedals) wear in their own ways.
Quick checklist
- Play every key across the full range, listening and feeling for keys that stick, feel looser than their neighbors, or don't register consistently at different velocities.
- Test all pedals, including half-pedaling response if the model supports it.
- Check every audio output and headphone jack, and test Bluetooth/USB/MIDI connectivity if the model has it.
- Look for physical damage to the case, hinges and control panel, and test every button, knob and display.
- Ask how it was used - constant gigging and transport is harder on a digital piano than stationary home use.
Unlike an acoustic piano, a digital piano has no serious ongoing maintenance cost if it checks out working - which also means a fully broken unit is usually not economical to repair, so testing thoroughly before buying matters more here than for acoustic instruments.