UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wKp20+iM6nohD3jM7Agr6rQmKVmjRXUz12jT3ISLwjg='
WHERE
key_id = 'cb79e0b1177ab33d88e066ddd5bbf77430a2f0f701153cb856d4dbccba024061'
AND (
token = 'wKp20+iM6nohD3jM7Agr6rQmKVmjRXUz12jT3ISLwjg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)