UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rC/wOXEGqsl4bO04yo0JA6kbWNLruqBGqJ4atwxpHJg='
WHERE
key_id = '688ea93bc0c92393bc1a3648c378852b342abf9970ace0920b2b4a30ef82aeda'
AND (
token = 'rC/wOXEGqsl4bO04yo0JA6kbWNLruqBGqJ4atwxpHJg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)