How can I search a column in MySQL containing unix timestamps with a query referencing a different format? I have a mysql table that contains something like: 

+-------------+-----------------+
| FOO1        | FOOTIME         |
+-------------+-----------------+
|        blah |   1234567890000 |
+-------------+-----------------+


FOOTIME uses unix timestamp. 

I want to run a query that essentially says "how many rows contain foo time older than January 1st 2012? 

I thought I'd want to do something like select count(*) from foodb.FOOTABLE where FOOTIME &lt;= TIMESTAMP('2012-01-01'); but that didn't work. 

What am I missing?
Try this:

SQL code:

SELECT COUNT(FOO1)
FROM footable
WHERE FOOTIME &gt;= UNIX_TIMESTAMP('2012-01-01');


SELECT COUNT(FOO1)
FROM footable
WHERE FROM_UNIXTIME(FOOTIME)&gt;='2012-01-01'; 


Sample data:

CREATE TABLE footable (
  FOO1 varchar(30) primary key,
  FOOTIME int(11)
  );

INSERT INTO footable (FOO1, FOOTIME)
VALUES ('blah', UNIX_TIMESTAMP(now() - INTERVAL 1 YEAR)),
('Blahblah', UNIX_TIMESTAMP(now() - INTERVAL 2 YEAR)),
('BLablahblah', UNIX_TIMESTAMP(NOW() - INTERVAL 5 YEAR));


SQLFiddle demo