It's obviously subjective, but IMO inline conditionals make code harder to read, indentation is very important to understand what's going on. So I'd definitely take the second approach, but writing it differently:
existing_transaction = database.find_transaction_by_id(transaction.id)
if !existing_transaction
database.create_transaction(transaction)
elsif !existing_transaction.processed
database.update_transaction(transaction)
end