UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GLiRhohOdoPHuk8zTMQfb6Y+NCqaA6YlIGc4wR4FOVk='
WHERE
key_id = '10639b8613ef1ddee9885c5a3a698cc89cd04a865eb4211fcf87b326c7be03eb'
AND (
token = 'GLiRhohOdoPHuk8zTMQfb6Y+NCqaA6YlIGc4wR4FOVk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)