You have to ask yourself what the risk is? The risk is missing the return flight and buying a new ticket. Can you accept that risk?
Ignoring the general advice of checking in two to three early. Take a realistic look at your timeline.
13.10 Departure
12.35 - Check in closes. Most European airline have a fairly strict check-in cut off of 45 minutes especially on international flights.
11.50 - Scheduled arrival in Madrid. You now have 45 mins to get off the plane, get to the check in area, etc. Now a whole bunch of variables kick in that you cannot control. Even if the plane is on time, could take ten minutes or more to deplane. What if the plane is late? Lands on time and delayed getting to the gate? Last gate on the concourse so it is the longest walk. For that flight to work everything has to be perfect and on time. When was the last time you had perfect flight? It is very risky, and I would say - stupid to book that tight a connection.
I would not do the earlier flight either. What happens if that plane is cancelled and back up is the later plane? That is not a good option either. Cancellations happen and it is more frequently with the budget airlines that don't have the backup support that bigger airlines do. Most of the experienced travelers here was go to Madrid the day before.