UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J+WA4yzSn7DAx8QCuclwTRwf9mB+4tiQfoVKIZu5vlU='
WHERE
key_id = 'c6af79d261c87207d6a98c0f595ca53cbc68ac2b44ee12f6edfcf2a2ce44454f'
AND (
token = 'J+WA4yzSn7DAx8QCuclwTRwf9mB+4tiQfoVKIZu5vlU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)