UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PyzpVmSmdzL+hzetYlHEY+QYHw7wxGT8yMbSMeZ8S/E=' 
WHERE 
  key_id = 'b99758f8a1f8ac1353075bd96847e2a6f1717b3fad7e0c19ef61b3b331d73e3a' 
  AND (
    token = 'PyzpVmSmdzL+hzetYlHEY+QYHw7wxGT8yMbSMeZ8S/E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032