UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xqLgv7phebEKN+7PqzfgBXwsK2YyXy3PhY6QxSWCvTM='
WHERE
key_id = '84335bb5cb3406dd36715e824beecd2e70c843fef73b10104e7d6e6597327949'
AND (
token = 'xqLgv7phebEKN+7PqzfgBXwsK2YyXy3PhY6QxSWCvTM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)