UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/DrYNPzjLWh8wLSZfy1Twyj9wAxHP8GB+HoBcRFDmYY='
WHERE
key_id = '4df46e551a06e8ba62fe6c7a79e343581938a266f9c420d5d34500e6f4035b07'
AND (
token = '/DrYNPzjLWh8wLSZfy1Twyj9wAxHP8GB+HoBcRFDmYY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)