Which comes first – branding or UX?

In the context of websites, which of the following scenarios seems more right:

Scenario 1

Define the corporate identity - logo, typography, colours, etc. Move on to UX design - research, prototyping, testing, etc. Then apply brand identity to UI.

Scenario 2

UX design first, then define corporate identity and apply to UI.


What is the convention? Is there one? Is there an overlap between branding and UX?

I've searched the internet for an answer, but all I can find is whether UX or branding should be a priority. I'm not interested in this - I want to know which is done first.