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

Query time 0.00031