UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I2K20Ag2G8NM9K8ugdsvt21zftlp53z9RpJIFzarGdw=' 
WHERE 
  key_id = '4693105f3730b1c66596a8fe593208324100fa2181c31f41538211ad83edde2c' 
  AND (
    token = 'I2K20Ag2G8NM9K8ugdsvt21zftlp53z9RpJIFzarGdw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040