SELECT 
  pc.product_id 
FROM 
  cscart_products_categories AS pc 
  JOIN cscart_products AS p ON pc.product_id = p.product_id 
WHERE 
  pc.category_id = 39 
  AND p.status = 'A' 
ORDER BY 
  RAND() 
LIMIT 
  1

Query time 0.00155

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "93.77"
    },
    "ordering_operation": {
      "using_temporary_table": true,
      "using_filesort": true,
      "nested_loop": [
        {
          "table": {
            "table_name": "pc",
            "access_type": "ref",
            "possible_keys": [
              "PRIMARY",
              "pt"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id"
            ],
            "key_length": "3",
            "ref": [
              "const"
            ],
            "rows_examined_per_scan": 205,
            "rows_produced_per_join": 205,
            "filtered": "100.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "1.52",
              "eval_cost": "20.50",
              "prefix_cost": "22.02",
              "data_read_per_join": "3K"
            },
            "used_columns": [
              "product_id",
              "category_id"
            ]
          }
        },
        {
          "table": {
            "table_name": "p",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY",
              "status"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "product_id"
            ],
            "key_length": "3",
            "ref": [
              "cscartdb.pc.product_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 120,
            "filtered": "59.01",
            "cost_info": {
              "read_cost": "51.25",
              "eval_cost": "12.10",
              "prefix_cost": "93.78",
              "data_read_per_join": "648K"
            },
            "used_columns": [
              "product_id",
              "status"
            ],
            "attached_condition": "(`cscartdb`.`p`.`status` = 'A')"
          }
        }
      ]
    }
  }
}

Result

product_id
41505