UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fas26b7XFXLIGle5JQ4GjhZKJPwbhb2PlrG9YHhk490='
WHERE
key_id = 'fd1645fb35070fcae6bc9bd85935835bebcbc399c2b04c26bade721fa826272d'
AND (
token = 'Fas26b7XFXLIGle5JQ4GjhZKJPwbhb2PlrG9YHhk490='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)