You can just use one update statement to update all the items status to 'colesed' where the enddate is passed. This is only if you don't need the item_id somewhere else.
So your code above can be;
string sql123 = "UPDATE items SET status ='closed' Where status='opened' AND endDate<=GETDATE()";
SqlCommand cmd21 = new SqlCommand(sql123, con);
cmd21.ExecuteNonQuery();
con.Close();