Better wordpress attachment query than this

I don’t have the data to test so the code below may be wrong.

add_filter('posts_search', 'set_is_tax_to_true' ,10,2);
function set_is_tax_to_true($search,$query){
    $query->is_tax = true;
}
$args = array(
    'post_type' => 'attachment',
    'posts_per_page' => -1,
    'post_status' => 'pending',
    'post_parent' => $post_id,
    'order' => 'ASC',
    'orderby' => 'ID',
    'meta_query'=> array(
       array(
           'key' => 'cp_sys_expire_date',
           'value' => current_time('mysql'),
           'compare' => '>',
           'type' =>  'DATE'
       )
   ));
$query = new WP_Query($args);
$images = $query->get_posts();
remove_filter('posts_search','set_is_tax_to_true',10);

It’ll generate SQL like SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts LEFT JOIN wp_posts AS p2 ON (wp_posts.post_parent = p2.ID) INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) WHERE 1=1 AND wp_posts.post_type="attachment" AND ((wp_posts.post_status="pending") OR (wp_posts.post_status="inherit" AND (p2.post_status="pending"))) AND ( (wp_postmeta.meta_key = 'cp_sys_expire_date' AND CAST(wp_postmeta.meta_value AS DATE) > '2013-04-08 10:11:09') ) GROUP BY wp_posts.ID ORDER BY wp_posts.ID

huh, very long SQL.

the set_is_tax_to_true hack is to force WP_Query to generate this
((wp_posts.post_status=”pending”) OR (wp_posts.post_status=”inherit” AND (p2.post_status=”pending”)))

Note: I assume the date stored in post meta is in the format of 2012-12-12 12:12:12. If not, please follow this link to change the meta_query argument