Thanks. Made it work. This is the code I used if anyone wants to have the same functionality.
$item = K2ModelItem::getData();
$publishup = $item->publish_up;
$query = "SELECT * FROM _k2_items WHERE id != {$id} AND catid={$catid} AND published=1 AND publish_up<($publishup} AND trash=0 ORDER BY publish_up DESC";
$query = "SELECT * FROM #__k2_items WHERE id != {$id} AND catid={$catid} AND published=1 AND publish_up>'{$publishup}' AND trash=0 AND publish_up <= ".$db->Quote($now)." ORDER BY publish_up ASC";