1SELECT orders.status, orders.created_at
2FROM `orders`
3ORDER BY
4 status='new' DESC,
5 status='processing' DESC,
6 CASE WHEN status IN ('new', 'processing') THEN created_at END ASC,
7 CASE WHEN status NOT IN ('new', 'processing') THEN created_at END DESC