Bitcoin transactions are funded by spending one or more unspent transaction outputs (utxo). Transaction outputs are uniquely identified by their outpoint which is composed from the identifier of the transaction that created the output and the position in the transaction’s outputs (txid:output_position).
In this scenario, it sounds like you have a single UTXO that is spent by both transactions. Since each transaction output can only be spent once, these two transactions conflict. Only one of them can be included in the best chain. Assuming that both transactions have roughly the same transaction weight, miners would prefer the second transaction as they would collect a drastically higher fee. Once the second transaction is confirmed (included in a block), the first transaction would appear invalid to any nodes. If the first transaction is included in a block before the miner sees the second, the second would be invalid.










