Records in a table unique period
There is no "constraint" in MySQL to achieve your complex constraint.  However, you could probably write a TRIGGER(s) that would check each INSERT and UPDATE to see if your requirements are violated.  The TRIGGER could act like a constraint -- barf on your INSERT/UPDATE.

I suspect (but do not know for a fact) that other DBMS also have no such constraint, yet do have a TRIGGER-like capability.