UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9RsxQCsLrxwINLpNmvPnkw+7jY/2cDUngRXlhdfBgLs='
WHERE
key_id = '9868ec792f48ff81dec19ec014aae021cfd5281cc9b167ebfc69b8faa2f9956c'
AND (
token = '9RsxQCsLrxwINLpNmvPnkw+7jY/2cDUngRXlhdfBgLs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)