UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wmR7Rdii9bQk/WLa8zRprlWg64bGp/AEhDy3aEXgxSo='
WHERE
key_id = '6b33ffcbf9955f7b14333f51faa30dba872f7bbe831352087048913b77c45d2a'
AND (
token = 'wmR7Rdii9bQk/WLa8zRprlWg64bGp/AEhDy3aEXgxSo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)