One should measure.
If you choose between the two options, the first one is trying to insert a row and on unique constraint violation updates the data. The second approach requires a list of boolean checks for each field you want to update. The length of the list is the number of rows you want to update. That is for many rows is a bad choice.
The option with INSERT may be dangerous in case a parralel process deletes several of the rows you are trying to update. In this case it will try to do its primary task: insert the rows.
But there is another option: to join a series of rows separated by UNION ALL with a table you want to update. This is the option I usually tend to use.
UPD: I added an answer with UNION ALL to the linked question.