UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QmwCTOaw/Ic+/5eBlQBxU307dZRtgr+ka0QuCSRKkak='
WHERE
key_id = 'fbbd760d868df7bbfa60374128cb376eb7a2e38151dd419c389db41ba5485d0e'
AND (
token = 'QmwCTOaw/Ic+/5eBlQBxU307dZRtgr+ka0QuCSRKkak='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)