You may encounter an issue where a device is locked behind an MDM Lock for a very long amount of time. The error will say something along the lines of:
"This Mac is Locked
The system PIN is required to use this Mac
Try again in 27529547 minutes"
Note: This will only happen at the MDM Lock screen and not Managed Activation Lock.
Image credit to Apple.
This likely happened because the device completely ran out of battery, and as such, the device reverted the system clock to January 1st, 1970 (Epoch 0, Unix time).
Options to Resolve
1 - Use an ethernet cable to connect to the network
Connecting the device to a network should allow the system clock to realize it has fallen back to a default option, thus contacting time servers and subsequently updating the time to something more accurate.
Note: you may need to perform a restart for the system clock changes to take effect.
2 - DFU the device
If option #1 does not help, you may need to perform a DFU of the device. Steps on this process can be found in Apple's article.
3 - Reach out to Apple
If neither of the above options help resolve the issue, you may want to schedule an appointment at a nearby Genius Bar or contact Apple online for further assistance.