UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '773/UsYebS5/W4CFR2V8TLNsYbQ8NBkUCH/uA2UyL2M='
WHERE
key_id = '0410a476668efaa67a267c48ab8b4b4032b05e4206d26a0b3e9ccff52fb3b36b'
AND (
token = '773/UsYebS5/W4CFR2V8TLNsYbQ8NBkUCH/uA2UyL2M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)