UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OqVXhhav/Ved0qgi8vAmmr9v5BKhehtud0nAJLMXhHw='
WHERE
key_id = '9f4f25771f87c49325c7ac2c54736a965bd0cf33f1d9c02bd03581da35af93e0'
AND (
token = 'OqVXhhav/Ved0qgi8vAmmr9v5BKhehtud0nAJLMXhHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)