ESPhome and home assistant can handle tags.
Don’t know how you would do it to check the MySQL but if you in ESPHome can trigger tag_scanned with the scanned ID you can handle it inside home assistant.
Maybe this can point you in the correct direction?
# In some trigger
on_...:
# Simple
- homeassistant.tag_scanned: some-tag