Sounds like you have PLENTY of time, I think you should go for it. Connections in Madrid are not hard to make, you may even try to check your luggage with CO all the way to BCN, even including your Air Europa ticket (they are partners). Even though you wouldn't be travelling on the "same" itenerary, you can show your Air Europa ticket to CO agent and they would be able to check your bags to the final destination.