You should have a recovery Key while installing the Gateway. Keep that in handy. Go to Control Panel--> Select on premise gateway and click on Change, it will prompt for Uninstall though it wont uninstall. Setup will run to fix the issue. and then you can download the latest version of Gateway and can install. it will automatically update the existing one.
Key is first to make the existing gateway run without any issue before we go for upgrade.
Also check you are able to login to powerbi.com from your browser. Browser authentication is required when you try to upgrade the gateway.