You can use a Record UDF and move your logic to server node. In the UDF, use the exists() api to check if the record exists, if it doesn’t, call aerospike:create() else call aerospike:update(). (Pass the k argument to the record udf. ) This will allow you to create/update in one i/o hit from the client to the server.
This topic has some relevant code that can help you get started: Adding Key and TTL when creating a record using Record UDF