UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nYHByBiro3InS6UypR2d4qSd+fGySOCyNI7vuKNzfR0='
WHERE
key_id = 'c7e1bc6757d7d1088ac2830534e7ab0914a7a786b1e6722c3c3d7ea3a7503d0d'
AND (
token = 'nYHByBiro3InS6UypR2d4qSd+fGySOCyNI7vuKNzfR0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)