UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XXDAQjKvI0qjJEcJP1v7Q+Y8HP1AD+AlDWY6PyZIXvE='
WHERE
key_id = '11a2675a19a1f22585a9ceece57721436a6e4571ebbb88c462babd36549b8311'
AND (
token = 'XXDAQjKvI0qjJEcJP1v7Q+Y8HP1AD+AlDWY6PyZIXvE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)