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

Query time 0.00028