UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A90NupBesgRFjURCmDMWlbZUabiEYfgPhqUZzfxPTwQ=' 
WHERE 
  key_id = '00d9e9f70212d1568892b1927ed6a33c8da26691aa78358b240e455d13cfd973' 
  AND (
    token = 'A90NupBesgRFjURCmDMWlbZUabiEYfgPhqUZzfxPTwQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047