title: MySQL unique key only where another key contains a specific value
body: <p>I have a table which contains meta data for users. There are 4 fields...</p>
  
  <pre><code>`ID`,`meta_name`,`meta_value`,`user_id`
  </code></pre>
  
  <p>I want to store emails in this table. Naturally these must be unique. However I want to store other data in this table as well, where the data does not need to be unique. Is there any way I can restrict <code>'meta_value'</code> to be unique, only if <code>'meta_name'</code> is equal to 'email'?</p>