UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y18ouhK7H1EthP6yPL/uJpaq3+S7JdOuCuFXgKKvW2c=' 
WHERE 
  key_id = 'bf40b562e57db079723b12f2d20629cd2eccdd962923d1bde7b1b09776e3d818' 
  AND (
    token = 'Y18ouhK7H1EthP6yPL/uJpaq3+S7JdOuCuFXgKKvW2c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048