UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GtchLBvzuwzYYoEyAiBrBGEveaFdn32hJG6o8wAzppo=' 
WHERE 
  key_id = 'c760db55c9bf0f98c422678f72b2e6f575481b9dd67c57bbc343db30bb2b6e85' 
  AND (
    token = 'GtchLBvzuwzYYoEyAiBrBGEveaFdn32hJG6o8wAzppo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044