You can do it as follows:
table.update_item(
Key={
'key': my_key
},
UpdateExpression="SET my_value = if_not_exists(my_value, :start) + :inc",
ExpressionAttributeValues={
':inc': my_increment,
':start': 0,
},
ReturnValues="UPDATED_NEW"
)
update_item Will create a new item or update existing ones.
UpdateExpression , my_value my_value + :inc.
my_value , :start .