DROP TABLE IF EXISTS items;
CREATE TABLE items (
id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
score1 INT,
score2 INT,
created_at DATETIME,
INDEX (score1, created_at, score2)
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 00:00:00");
INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 00:00:00");
INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 00:00:00");
INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-01 12:00:00");
INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-01 12:00:00");
INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-01 12:00:00");
INSERT INTO items (score1, score2, created_at) VALUES(1, 0, "2015-07-02 00:00:00");
INSERT INTO items (score1, score2, created_at) VALUES(2, 0, "2015-07-02 00:00:00");
INSERT INTO items (score1, score2, created_at) VALUES(3, 0, "2015-07-02 00:00:00");
SELECT *
FROM items
WHERE score1 = 2 AND created_at >= "2015-07-01 12:00:00"
       ORDER BY created_at DESC;
id	score1	score2	created_at
8	2	0	2015-07-02 00:00:00
5	2	0	2015-07-01 12:00:00
DROP TABLE items;
