SELECT 
  AVG (dr.rating_value) 
FROM 
  cscart_discussion_rating AS dr 
  LEFT JOIN cscart_discussion_posts AS dp ON dp.post_id = dr.post_id 
  LEFT JOIN cscart_discussion AS d ON d.thread_id = dp.thread_id 
WHERE 
  d.object_id = 0 
  AND d.object_type = 'E' 
  AND type IN ('B', 'R') 
  AND d.company_id = 1 
  AND dp.status = 'A' 
  AND dr.rating_value > 0

Query time 0.00091

JSON explain

{
  "query_block": {
    "select_id": 1,
    "table": {
      "table_name": "d",
      "access_type": "const",
      "possible_keys": ["PRIMARY", "object_id", "company_id"],
      "key": "object_id",
      "key_length": "10",
      "used_key_parts": ["object_id", "object_type", "company_id"],
      "ref": ["const", "const", "const"],
      "rows": 1,
      "filtered": 100
    },
    "table": {
      "table_name": "dp",
      "access_type": "ref",
      "possible_keys": ["PRIMARY", "thread_id", "thread_id_2"],
      "key": "thread_id",
      "key_length": "3",
      "used_key_parts": ["thread_id"],
      "ref": ["const"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "(dp.`status` = 'A')"
    },
    "table": {
      "table_name": "dr",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY"],
      "key": "PRIMARY",
      "key_length": "3",
      "used_key_parts": ["post_id"],
      "ref": ["egkcysbp_cscartn.dp.post_id"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "(dr.rating_value > 0)"
    }
  }
}

Result

AVG (dr.rating_value)
4.5000