SELECT 
  cscart_cp_object_ship_rest.shipping_id 
FROM 
  cscart_cp_object_ship_rest 
  LEFT JOIN cscart_shippings ON cscart_shippings.shipping_id = cscart_cp_object_ship_rest.shipping_id 
WHERE 
  (
    (
      cscart_cp_object_ship_rest.object_id = 339 
      AND cscart_cp_object_ship_rest.object_type = 'p' 
      AND cscart_cp_object_ship_rest.company_id = 1
    ) 
    OR (
      cscart_cp_object_ship_rest.object_id IN (1) 
      AND cscart_cp_object_ship_rest.object_type = 'c'
    )
  ) 
  AND cscart_shippings.status = 'A'

Query time 0.00045

JSON explain

{
  "query_block": {
    "select_id": 1,
    "table": {
      "table_name": "cscart_cp_object_ship_rest",
      "access_type": "index",
      "possible_keys": ["object_id"],
      "key": "object_id",
      "key_length": "13",
      "used_key_parts": ["object_id", "shipping_id", "object_type", "company_id"],
      "rows": 6,
      "filtered": 33.333,
      "attached_condition": "cscart_cp_object_ship_rest.object_id = 339 and cscart_cp_object_ship_rest.company_id = 1 and cscart_cp_object_ship_rest.object_type = 'p' or cscart_cp_object_ship_rest.object_id = 1 and cscart_cp_object_ship_rest.object_type = 'c'",
      "using_index": true
    },
    "table": {
      "table_name": "cscart_shippings",
      "access_type": "eq_ref",
      "possible_keys": ["shipping_id"],
      "key": "shipping_id",
      "key_length": "3",
      "used_key_parts": ["shipping_id"],
      "ref": ["herbaria_cscart_4_18.cscart_cp_object_ship_rest.shipping_id"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "cscart_shippings.`status` = 'A'"
    }
  }
}