UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UcD24ADqfCcC4F28lHOSnk33/v7SU4OB9k8EBEPWVoI='
WHERE
key_id = '42d09c976039426fa134b21f120a8e9ce5c6f1500c70ee9de0269e50a1a71c5e'
AND (
token = 'UcD24ADqfCcC4F28lHOSnk33/v7SU4OB9k8EBEPWVoI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)