how many roms did you have when it happened? how many do you have now? had you scraped data for your roms before/now?
with emulation station, the only exit options that save all the metadata changes (“last played”, anything you’ve edited manually, etc), are F4, and “exit emulation station” in the ‘start’ menu. if you shutdown/restart your system, it will just terminate the process and not save anything. there is an issue raised about this – both why it takes so long, and why the other exit options don’t save the metadata.
in my experience, having a lot of roms will mean that terminating ES ‘properly’ (ie, via F4 or ‘exit emulation station’) takes ages.