UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F4s7+NmDObXEdoWv0yVZvq2JZvw3V21f9W7ch4BSlco='
WHERE
key_id = '54da3539a5186401f07657731283a67a6bd71ccda4a1fa94748ba4ca09522aa5'
AND (
token = 'F4s7+NmDObXEdoWv0yVZvq2JZvw3V21f9W7ch4BSlco='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)