UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9N708p+Tk8HL6gaLxjgS75pbGYMi/wAgp+lKb3wbtus='
WHERE
key_id = '1f57b8434c10a9ba7cba87ee71b003e10281e54223f3e3162f74a665b8bf6db6'
AND (
token = '9N708p+Tk8HL6gaLxjgS75pbGYMi/wAgp+lKb3wbtus='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)