UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f4qLtYltFhvOFrFli++QZ8nJAirlogpPHPVjX/E9R/k='
WHERE
key_id = '5f0761b49c75c341d4e110d065f54907f46bf8c9b177edb2cbde930ff939def6'
AND (
token = 'f4qLtYltFhvOFrFli++QZ8nJAirlogpPHPVjX/E9R/k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)