Well, the obvious question is, why are you inserting data into your database you don't want? It makes more sense to just not do the insert.
But, assuming perhaps you have no control over the client, you can create a BEFORE INSERT trigger that rejects the inserts that don't match your condition: