UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NsHLlfS1XG1bEmL2UEOSDAKABNR6nQbBAUp5Ms/7V+M=' 
WHERE 
  key_id = '446f6a1aef862ac48d7ee3c65ea0cecc73dec693870f9ff2d0303bb4f17ae872' 
  AND (
    token = 'NsHLlfS1XG1bEmL2UEOSDAKABNR6nQbBAUp5Ms/7V+M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047