UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6atI0QcdLUEx4EDLlPzrg4gcTzUU8cyVAtuWHdMtYWc='
WHERE
key_id = '07c7f3e7d9c62185513876ba1004d194598c0217dced38675a59be156c393c24'
AND (
token = '6atI0QcdLUEx4EDLlPzrg4gcTzUU8cyVAtuWHdMtYWc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)