UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rJwSNac/sRiwIgVMk/S5tKf1vP+xuTx2fZ5pAbvggww=' 
WHERE 
  key_id = 'f46916ddbf4f08b854c251fb4d485cdcdac4b6b1275dc163dce3f84446f1071b' 
  AND (
    token = 'rJwSNac/sRiwIgVMk/S5tKf1vP+xuTx2fZ5pAbvggww=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031