Storing a combination of IDs
Well, I think the questions is not well formulated, but as far as I got it:


You have a table containing two columns user_id and company_id
You have set the user_id to be AUTO_INCREMENT (so it's a PRIMARY KEY)
You are willing to change this column to user_id + "_" + company_id to make it UNIQUE


Answer: you're doing it wrong

Both data must not be concatenated.

Instead, what you want is a (user_id, company_id) UNIQUE KEY, which can be done with an ALTER TABLE my_table ADD UNIQUE INDEX user_company (user_id, company_id).

Thus, the way you want your AUTO_INCREMENT to work is not clear. IMO, you should remove it from the user_id, and add it on a new dedicated column id. Then, when you INSERT/UPDATE in that table, you'll have to know the user_id you're inserting/updating, which makes sense since that user_id is no longer UNIQUE to identify a row.