Go regexes unfortunately do not support negative matches. I believe you can get the behavior that you need by having a temporary label, and changing it based on the various conditions:
1. you want to keep all metrics by default (action replace, target __tmp_keep, replacement "yes")
2. you want to drop all unit state metrics (action replace, source labels __name__, match "node_systemd_unit_state", target __tmp_keep, replacement "no")
3. you want to keep all unit state metrics where name matches (action replace, source labels [__name__,name], match "node_systemd_unit_state;(mysql|postrgresql).*", target __tmp_keep, replacement yes)
4. act on the temporary label (action keep, source labels _tmp_keep, match "yes")
/MR