title: SQL Get all records older than 30 days
body: <p>Now I've found a lot of similar SO questions including an old one of mine, but what I'm trying to do is get any record older than 30 days but my table field is unix_timestamp. All other examples seem to use DateTime fields or something. Tried some and couldn't get them to work.</p>
  
  <p>This definitely doesn't work below. Also I don't want a date between a between date, I want all records after 30 days from a unix timestamp stored in the database. 
  I'm trying to prune inactive users.</p>
  
  <p>simple examples.. doesn't work. </p>
  
  <pre><code>SELECT * from profiles WHERE last_login &lt; UNIX_TIMESTAMP(NOW(), INTERVAL 30 DAY)  
  </code></pre>
  
  <p>And tried this</p>
  
  <pre><code>SELECT * from profiles WHERE UNIX_TIMESTAMP(last_login - INTERVAL 30 DAY) 
  </code></pre>
  
  <p>Not too strong at complex date queries. Any help is appreciate. </p>