Besides, what Ronald suggested, you could create one more attribute, which should be a calculated attribute formed by the concatenation of the two attributes. You can make this attribute as unique. You would still need to use the before commit event to calculate this field.
Use a before commit microflow that checks the combined values and give a response back if the combination already exist.
Regards,
Ronald