UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZF79sU1NEnhfMovq51hAFFwqQt+PWasPLzNd17Lm14Y=' 
WHERE 
  key_id = '55529691e04d9db70d4a3fd6e5912f9e800b326cafc69c9c9e74b260a8c1d77b' 
  AND (
    token = 'ZF79sU1NEnhfMovq51hAFFwqQt+PWasPLzNd17Lm14Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028