UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mI1eYSvlKIJjZINTWdDi856TP0W/KM1e8UlYAd+b0oI=' 
WHERE 
  key_id = 'bdf3805756030a1fcc5f585762cbb61c74347c95efba7afa1732b0a9ec75d60a' 
  AND (
    token = 'mI1eYSvlKIJjZINTWdDi856TP0W/KM1e8UlYAd+b0oI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015